FROM ubuntu:16.04
MAINTAINER wuhongliang@neigou.com 2020.11.27

ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=Asia/Shanghai
#set localtime
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
    && echo $TZ > /etc/timezone

COPY FileRewrite/etc/apt/sources.list /etc/apt/sources.list

RUN apt-get update \
    && apt-get install -y vim \
    wget \
    curl \
    inetutils-ping \
    dnsutils \
    unzip \
    ssh \
    software-properties-common
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \
    && add-apt-repository -y ppa:nginx/stable \
    && apt-get update
RUN apt-get -y install \
    make \
    nginx \
    php7.3-dev \
    php7.3-mysql \
    php7.3-imagick \
    php7.3-gd \
    php7.3-fpm \
    php7.3-curl \
    php7.3-cli \
    php7.3-json \
    php7.3-redis \
    php7.3-soap \
    php7.3-zip \
    php7.3-mbstring

ADD entrypoint.sh /root/
ADD install_env.sh /root/
COPY FileRewrite/ /
RUN chmod +x /root/*.sh \
    &&/root/install_env.sh \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

EXPOSE 80

ENTRYPOINT ["/root/entrypoint.sh"]
CMD ["nginx"]
